﻿using System;

namespace Tools.MAME
{
    ///-------------------------------------------------------------------------------------------------
    /// <summary> A database item. </summary>
    ///-------------------------------------------------------------------------------------------------
    public class DbItem
    {
        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the name. </summary>
        /// <value> The name. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Name { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the description. </summary>
        /// <value> The description. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Description { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the custom description (saved into game lists.) </summary>
        /// <value> The custom game list description. </value>
        ///-------------------------------------------------------------------------------------------------
        public String CustomDescription { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the clone of attribute. </summary>
        /// <value> The clone of attribute. </value>
        ///-------------------------------------------------------------------------------------------------
        public String CloneOf { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the region. </summary>
        /// <value> The region. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Region { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the year. </summary>
        /// <value> The year. </value>
        ///-------------------------------------------------------------------------------------------------
        public int? Year { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the manufacturer. </summary>
        /// <value> The manufacturer. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Manufacturer { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the number of players. </summary>
        /// <value> The number of players. </value>
        ///-------------------------------------------------------------------------------------------------
        public int? PlayerCount { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the number of buttons. </summary>
        /// <value> The number of buttons. </value>
        ///-------------------------------------------------------------------------------------------------
        public int? ButtonCount { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the status. </summary>
        /// <value> The status. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Status { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the category. </summary>
        /// <value> The category. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Category { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the sub-category. </summary>
        /// <value> The sub-category. </value>
        ///-------------------------------------------------------------------------------------------------
        public String SubCategory { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets the is mature flag. </summary>
        /// <value> The is mature flag. </value>
        ///-------------------------------------------------------------------------------------------------
        public bool? IsMature { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets or sets a value indicating whether a CHD is required. </summary>
        /// <value> True if chd is required, false if not. </value>
        ///-------------------------------------------------------------------------------------------------
        public bool CHDRequired { get; set; }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Gets the group. </summary>
        /// <value> The group. </value>
        ///-------------------------------------------------------------------------------------------------
        public String Group
        {
            get
            {
                if (String.IsNullOrWhiteSpace(CloneOf))
                    return Name;
                else
                    return CloneOf;
            }
        }

        ///-------------------------------------------------------------------------------------------------
        /// <summary> Default constructor. </summary>
        ///-------------------------------------------------------------------------------------------------
        public DbItem()
        { }
    }
}
